Set up a few directories we'll need

  $ . ./setup.sh
  $ mkdir -p lib
  $ mkdir -p app
  $ mkdir -p lib/.objs/melange
  $ mkdir -p app/.objs/melange
  $ mkdir -p output/lib
  $ mkdir -p output/app

  $ echo "let t = 1" > lib/a.ml
  $ echo "let t = A.t" > app/b.ml

Test that `-bs-package-name` works with `-bs-module-type` and not setting
`-bs-package-output`

  $ BSPKG="-bs-package-name myPackage"
  $ melc $BSPKG -bs-package-output lib/ -bs-stop-after-cmj lib/a.ml -o lib/.objs/melange/a.cmj

  $ melc $BSPKG -bs-package-output app/ -I lib/.objs/melange app/b.ml -bs-stop-after-cmj -o app/.objs/melange/b.cmj

The linking step just needs `-bs-module-type`, it already knows the package
paths

  $ melc $BSPKG -bs-module-type commonjs lib/.objs/melange/a.cmj -o output/lib/a.js

  $ melc $BSPKG -bs-module-type commonjs -I lib/.objs/melange app/.objs/melange/b.cmj -o output/app/b.js

  $ melc $BSPKG -bs-package-output commonjs:lol -I lib/.objs/melange app/.objs/melange/b.cmj -o output/app/b.js

B depends on A, so it should import a.js in the right path

  $ cat output/app/b.js
  // Generated by Melange
  'use strict';
  
  const A = require("../lib/a.js");
  
  const t = A.t;
  
  module.exports = {
    t,
  }
  /* No side effect */
